<?php defined('SYSPATH') or die('No direct script access.');
/**
* Module Simple Products
*/
class Module_accreport_reportproducts {
	
	private $controller;
	private $ss;
	private $thesystems;
	private $myfunctions;
	private $mydatetime;
	private $message;
	private $arraylist;
	
	static function &factory() {
	   $o = new Module_accreport_reportproducts();
	  return $o;	
	}
	
	public function __construct()
	{
		$this->controller	  = Request::current()->controller();
		$this->ss						= Session::instance();
		$this->thesystems		= Helper_theSystems::factory();
		$this->myfunctions	= Helper_myFunctions::factory();
		$this->mydatetime		= Helper_MyDateTime::factory();
		$this->message			= Language_Message::factory();
		$this->arraylist		= Helper_ArrayList::factory();
	}
	
	public function reportproducts()
	{
		$check_proddetail = $this->thesystems->system_auth('module_products_detail_type');
		$table = ($check_proddetail == 'skus' ? 'skus' : 'ucts');

		$productlists = DB::select()
			->from('prod'.$table)
			->execute()
			->as_array();

		$content['title']		= 'Products Report';
		$content['content']	= View::factory('report/reportproducts')
			->set('productlists',$productlists)
			->render();
		
		return $content;
	}



}